From: Jonas Dreßler Date: Thu, 8 Aug 2019 22:18:38 +0000 (+0200) Subject: iconGrid: Only add one onComplete callback for the animations X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~832^2^2~33 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6f4c5022ebf9a29584c4347bce9f5c9602b77a34;p=gnome-shell.git iconGrid: Only add one onComplete callback for the animations We only need a callback on the last animated actor, so no need to register the callback for all actors. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 1fbf416c5..e0a1e8bd8 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -545,12 +545,12 @@ var IconGrid = GObject.registerClass({ scale_y: 1, duration: ANIMATION_TIME_IN, mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD, - delay, - onComplete: () => { - if (isLastItem) - this._animationDone(); - } + delay }; + + if (isLastItem) + movementParams.onComplete = this._animationDone.bind(this); + fadeParams = { opacity: 255, duration: ANIMATION_FADE_IN_TIME_FOR_ITEM, @@ -571,13 +571,12 @@ var IconGrid = GObject.registerClass({ scale_y: scaleY, duration: ANIMATION_TIME_OUT, mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD, - delay, - onComplete: () => { - if (isLastItem) { - this._animationDone(); - } - } + delay }; + + if (isLastItem) + movementParams.onComplete = this._animationDone.bind(this); + fadeParams = { opacity: 0, duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,